Repository navigation
Conversation
Signed-off-by: john <cjx0709@gmail.com>
Signed-off-by: john <cjx0709@gmail.com>
Signed-off-by: john <cjx0709@gmail.com>
Contributor
|
A user listed in .github/CI_PERMISSIONS.json must comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Keep building the full global KV cache during long cached prefills and run the late decoder layers only for the final SWA window of each prompt. This reduces work on chunks that are still before the decoder window.
Modifications
--enable-decoder-swa-bounded-replay. The implementation requires encoder SWA replay, shifted mHC, the direct TPU compiler, and monolithic text serving. Routed expert capture is rejected because its full-layout output would not match compact decoder rows.python/sglang/srt/models/identical tomain.Accuracy Tests
True-weight DeepSeek-V4.1-Flash with DSpark K5 on one 4-physical-chip v7x host, DP8/EP8, direct tracer with SPMD, and TorchTPU 0.3.0. The device measurements below are from
c1be650215, before the output-only logprob fix and the plugin hook migration.Before marking ready for review, compare first-token logits on the cold 4K case against a same-weight reference using the same prompt-tail policy. Check the source-layer global KV, tail hidden states, and decoder SWA before comparing the first verify and post-commit draft KV. Repeat across cold and cached inputs with a representative DSpark workload. Rerun output-only logprobs on a TPU server without speculation. Collect first-token logits internally for the K5 run because the experimental TPU spec worker does not serve logprobs.
Speed Tests and Profiling
Five warm measurement waves per arm used the same machine, checkpoint, fixture, and runtime. The step metric is host cadence between adjacent prefill markers when all eight ranks processed 2,048 new rows at both endpoints. The measured intervals exclude admission, boundary steps, and logged recompiles.
The replay arm reduced median middle-step cadence by 53.4%. Runtime logs showed zero decoder rows across the eight ranks on those interior steps and 128 live decoder rows per rank at the final prompt step. The single-step XPlane begins the encoder computation and ends before the full device program completes. A complete trace remains pending.
CI States
Latest PR Test (Base): ❌ Run #45168486659
Latest PR Test (Extra): ❌ Blocked --
run-ciis required first.Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: